<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body>
<div ng-app="myApp" ng-controller="personCtrl">
    <button ng-click="toggle()">隐藏/显示</button>
    <p ng-hide="myVar">
        名: <input type="text" ng-model="firstName" ng-blur="blur()"><br>
        姓名: <input type="text" ng-model="lastName" ng-paste="paste()"><br>
        age: <input type="text" ng-model="age" ng-click="hoverAdd()"><br>
        邮箱: <input type="text" ng-model="email" ng-focus="focus()"><br>
        <br>
        输入的信息: {{firstName + " " + lastName+ " " +  age + " " + email}}
    </p>
</div>
<script>
    var app = angular.module('myApp', []);
    app.controller('personCtrl', function ($scope) {
        $scope.firstName = "John",
            $scope.lastName = "Doe",
            $scope.myVar = false;
            $scope.age = 18;
            $scope.email = 'iyahe@qq.com';
        //点击事件
        $scope.toggle = function () {
            $scope.myVar = !$scope.myVar;
        };
        $scope.click = function () {
            console.log('我被点击了...');
        }
        $scope.dblclick = function () {
            console.log('我被双击了...');
        }
        $scope.blur = function () {
            console.log('我失去焦点了...');
        }
        $scope.focus = function () {
            console.log('我获得焦点了...');
        }
        $scope.change = function () {
            console.log('我的内容被改变了...');
        }
        //复制。鼠标右键复制和快捷键Ctrl+C都会触发。
        $scope.copy = function () {
            console.log('我被copy了~~');
        }
        //剪切。鼠标右键剪切和快捷键Ctrl+X都会触发。
        $scope.cut = function () {
            console.log('我被cut了~~');
        }
        //粘贴。鼠标右键粘贴和快捷键Ctrl+V都会触发。
        $scope.paste = function () {
            console.log('我被粘贴进来东西了');
        }
        //键盘按键按下
        $scope.keydown = function ($event) {
            console.log('按键了');
        }
        $scope.hover = function () {
            console.log('我把手放input上面了');
        }
        $scope.hoverAdd = function () {
            $scope.age++;
            console.log('点我年龄++');
        }
    });
    // 更多事件 https://segmentfault.com/a/1190000002634554
</script>
</body>
</html>